import M from '../../../../common/typeMutations'

const state = {
  protocol: 'http://',
  feedUrl: '127.0.0.1:8360/download/',
  msg: {
    error: '检查更新出错',
    checking: '正在检查更新',
    updateAva: '检测到新版本',
    updateNotAva: '现在使用的就是最新版本，不用更新',
    downloadProgress: '正在下载中...',
    updateDownloaded: '下载已完成，是否立即重启'
  },
  visible: false,
  downloadPercent: 0,
  updateTips: '',
  updateStatus: 2
}

const mutations = {
  [M.SYSTEM.setUpdateTips] (state, data) {
    state.updateTips = data
  },
  [M.SYSTEM.setDownLoadProgress] (state, data) {
    state.downloadPercent = data
  },
  [M.SYSTEM.setUpdateStatus] (state, data) {
    state.updateStatus = data
  },
  [M.SYSTEM.setFeedUrl] (state, data) {
    state.feedUrl = data
  }
}

const actions = {}

export default {
  state,
  mutations,
  actions
}
